<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To Disable Virtual machine platform # Note: We will disable the 'HypervisorPlatform' and 'VirtualMachinePlatform' Windows optional features. # Configuration Type - COMPUTER #> $featureNames = @("HypervisorPlatform", "VirtualMachinePlatform") foreach ($featureName in $featureNames) { $Feature = Get-WindowsOptionalFeature -FeatureName $featureName -Online if ($Feature.State -eq "Disabled") { $null = Enable-WindowsOptionalFeature -FeatureName $featureName -NoRestart -Online -WarningAction SilentlyContinue Write-Host "$featureName feature is disabled successfully." Write-Host "A restart is required." } else { Write-Host "$featureName feature is already disabled." } }